<template>
	<collapse class="model" title="灌溉模式">
		<intel-irri-model-timer class="timer" :state="timer.state" :hour="timer.hour" :minute="timer.minute" @start="timerIrrigationStart" @add="timerIrrigationAdd"></intel-irri-model-timer>
		<intel-irri-model-limit class="limit" :state="limit.state" @start="limitIrrigationStart"></intel-irri-model-limit>
	</collapse>
</template>

<script>
	import collapse from '@/components/collapse.vue'
	import intelIrriModelLimit from './model/intel-irri-model-limit.vue'
	import intelIrriModelTimer from './model/intel-irri-model-timer.vue'
	export default{
		data() {
			return {
			}
		},
		methods:{
			timerIrrigationStart(){
				this.$emit('timer-irrigation-start')
			},
			timerIrrigationAdd(){
				this.$emit('timer-irrigation-add')
			},
			limitIrrigationStart(){
				this.$emit('limit-irrigation-start')
			},
		},
		components: {
			intelIrriModelLimit,
			intelIrriModelTimer,
			collapse
		},
		props: {
			timer: {
				type: Object,
				// required: true,
				validator: (timer)=>{
					return true;
				}
			},
			limit:{
				type: Object,
				// required: true,
				validator: (limit) => {
					return true;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.model{
		border: 1.17rpx solid #3A615B;
		border-radius: 11.76rpx;
		padding: 8.23rpx 18.82rpx;
		.timer{
			width: 612.94rpx;
			// height: 267.05rpx;
			margin: 17.64rpx 0 9.41rpx;
		}
		.limit{
			width: 612.94rpx;
			// height: 391.76rpx;
		}
	}
</style>
